require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'

class TC_Admin < Test::Unit::TestCase
  def test_32
    $ie.goto($UniVar)
    $ie.refresh()
    $ie.refresh()
    
    $ie.link(:text, 'Control Panel').click
    $ie.link(:text, 'Administration').click
    $ie.table(:index, 4).click
    $ie.link(:index, 13).click
    $ie.text_field(:index, 1).value = "testCreateBlog"
    $ie.text_field(:index, 2).value = "TRYALLCAPITALLETTERS"
    $ie.text_field(:index, 3).value = $ADMIN
    $ie.link(:text, 'Save').click
    $ie.link(:text, 'Exit Control Panel and Return to Site').click
    $ie.link(:text, 'Blogs').click
    $ie.link(:text, 'Blogs on this Site').click
    temp = $ie.url()
    assert(temp = 'http://localhost/cs/blogs/tryallcapitalletters/default.aspx')
    
    $ie.goto($UniVar + '/controlpanel/BlogAdmin/Blogs.aspx')    
    $ie.wait()
    $ie.link(:text, 'Delete').click_no_wait
    hwnd = $ie.enabled_popup(20)
      if(hwnd)
        w = WinClicker.new
        w.clickWindowsButton_hwnd(hwnd, "OK")
      end
  end
end